Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc] Remove deprecated Python APIs #3725

Merged
merged 7 commits into from
Dec 7, 2021

Conversation

izackwu
Copy link
Contributor

@izackwu izackwu commented Dec 6, 2021

This PR tries to remove all these deprecated Python APIs and it resolves #3590.

Before merging, we need to make sure all these APIs...

  • @deprecated('kernel_profiler_print()', 'print_kernel_profile_info()')
  • @deprecated('kernel_profiler_clear()', 'clear_kernel_profile_info()')
  • @deprecated('memory_profiler_print()', 'print_memory_profile_info()')
  • @deprecated('ti.cache_shared', 'ti.block_local')
  • @deprecated('ti.var', 'ti.field')
  • @deprecated("ti.indices", "ti.axes")
  • @deprecated('ti.Matrix.transposed(a)', 'a.transpose()')
  • @deprecated('a.T()', 'a.transpose()')
  • @deprecated('ti.Matrix.var', 'ti.Matrix.field')
  • @deprecated('ti.Vector.var', 'ti.Vector.field')
  • @deprecated('x(i, j)', 'x.get_scalar_field(i, j)')
  • @deprecated('_bit_struct', 'bit_struct')
  • @deprecated('_bit_array', 'bit_array')
  • @deprecated('x.data_type()', 'x.dtype')
  • @deprecated('x.dim()', 'len(x.shape)')
  • @deprecated('x.shape()', 'x.shape')
  • @deprecated('x.get_shape(i)', 'x.shape[i]')
  • @deprecated('ti.vec(x, y)', 'ti.core_vec(x, y)')
  • @deprecated('ti.veci(x, y)', 'ti.core_veci(x, y)')
  • @deprecated('gui.has_key_pressed()', 'gui.get_event()')

...can be safely deleted by checking other repos under Taichi including

This PR will follow such steps:

  • Remove these APIs from Taichi code
  • Make sure all Python tests pass
  • Fix other repos' dependence on these outdated APIs

@CLAassistant
Copy link

CLAassistant commented Dec 6, 2021

CLA assistant check
All committers have signed the CLA.

@netlify
Copy link

netlify bot commented Dec 6, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: c36d9fd

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61af4eca35001d0008c336f1

@izackwu izackwu changed the title [misc] Remove deprecated Python APIs [misc] Remove deprecated Python APIs (WIP) Dec 6, 2021
@izackwu
Copy link
Contributor Author

izackwu commented Dec 7, 2021

I think I have fixed most things so far. Please take a look @alizhang @k-ye :)

BTW, as for other repos, I'm not sure whether it's really necessary to manually check their dependence on deprecated APIs:

  • It's tedious to do so
  • They've already locked the version of Taichi in requirements.txt like taichi==0.8.1, so they won't break
  • My personal reason: I'm using MackBook with M1 chip, it's a bit harder to for me set up their various running environments 🥲

So I just fixed two important ones (as mentioned by @k-ye), while leaving other repos as they are

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!!



func()
ti.dot(x, x)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this file was used to demo the deprecated warning message. Shall well remove it then? ;)

Copy link
Contributor Author

@izackwu izackwu Dec 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, as I have removed the deprecated APi (transposed), this demo would break. So I just picked another deprecated API (yes, there're still some more APIs to deprecate in the codebase and they are not included in this PR) for the demo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha I see, makes sense! Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ailzhang Do we need another issue for other deprecated APIs not covered here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad to help if we're going to remove all remaining deprecated APIs :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@izackwu awesome thanks! Would you mind opening an issue as well? Thanks a lot!

@izackwu izackwu changed the title [misc] Remove deprecated Python APIs (WIP) [misc] Remove deprecated Python APIs Dec 7, 2021
@ailzhang ailzhang merged commit 5953e03 into taichi-dev:master Dec 7, 2021
@izackwu izackwu deleted the zackwu/remove-deprecated-apis branch December 7, 2021 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated APIs
4 participants